//
//  ViewController.m
//  10703面积体积
//
//  Created by student on 16/2/22.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"
#import "AreaViewController.h"
#import "VolumeViewController.h"
@interface ViewController ()

@property (nonatomic,strong) AreaViewController *Area;
@property (nonatomic,strong) VolumeViewController *Bulk;
@property (nonatomic,assign) BOOL *cur;
@end

@implementation ViewController

- (AreaViewController *)Area
{
    if (!_Area) {
        _Area = [[AreaViewController alloc]init];
    }
    return _Area;
}

- (VolumeViewController *)Bulk
{
    if (!_Bulk) {
        _Bulk = [[VolumeViewController alloc]init];

    }
    return _Bulk;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self area:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)area:(id)sender {
    [self.view insertSubview:self.Area.view atIndex:0];
    [self.Bulk.view removeFromSuperview];
}
- (IBAction)volume:(id)sender {
    [self.view insertSubview:self.Bulk.view atIndex:0];
    [self.Area.view removeFromSuperview];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
